<template>
	<view>
		<view class="titi">
			<image class="im2" :src="srcTop()"></image>
		</view>
		<view class="tit">已加入校友会</view>
		<view class="tab1">
			<erlei class="jx" :typeMsg="1">
				<view class="tr">地方校友会</view>
			</erlei>
			<dangq class="dq" :typeMsg="2">
				<view class="tr">院系校友会</view>
			</dangq>
			<xingz class="xz" :typeMsg="0">
				<view class="tr">行业校友会</view>
			</xingz>
		</view>
	</view>
</template>

<script>
	import erlei from 'pages/personal_center/erlei'
	import dangq from 'pages/personal_center/dangq'
	import xingz from 'pages/personal_center/xingz'

	let app = getApp();
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		components: {
			'erlei': erlei,
			'dangq': dangq,
			'xingz': xingz
		},
		data() {
			return {
				join: [],
				size: 10,
				page: 0,
				type: -1,
				message: '暂无已加入校友会'
			}
		},
		computed: {
			...mapState(['userId', 'token', 'userName', 'wxNickName'])
		},
		onLoad() {		
		},
		methods: {
			byType: function(type) {
				console.log("byType", type);
				this.page = 0;
				this.type = type;
				uni.request({
						url: app.globalData.URL + 'associationUserInfo/queryType?userId=' + this.userId + '&page=' + this.page +
							'&size=' + this.size + '&type=' + this.type,
						method: 'GET'
					})
					.then(data => { //data为一个数组，数组第一项为错误信息，第二项为返回数据
						var [error, res] = data;
						this.join = res.data;
						console.log("byType", this.join);
						return res.data
					})
			},
			toDate: function(time) {
				let date = new Date(time); //获取一个时间对象
				let dateString = date.getFullYear() + '-' + (parseInt(date.getMonth()) + 1) + '-' + date.getDate();
				//console.log(dateString)
				return dateString;
			},
			srcTop: function() {
				return app.globalData.Link + 'file/system/top.jpg';
			}
		},
	}
</script>

<style>
	.titi {
		height: 150rpx;
		background-color: #FFFFFF;
	}

	.im2 {
		width: 100%;
		height: 150rpx;
	}

	.tit {
		margin: 10rpx 20rpx;
		/* color: #3F536E; */
		font-size: 40rpx;
		height: 60rpx;
		border-bottom: 1px solid #3F536E;
	}

	.tab {
		width: 95%;
		margin: 20rpx 20rpx;
		display: flex;
		border-bottom: 1px solid #3F536E;
	}

	.tab1 {
		width: 95%;
		margin: 20rpx 20rpx;
		/* display: flex; */
		/* border-bottom: 1px solid #3F536E; */
	}

	.shul {
		margin-left: 550rpx;
	}

	.tex {
		margin-top: 10rpx;
		color: #636363;
		font-size: 35rpx;
	}
</style>
